package com.miaosha.fx.jsjava;

import java.util.Date;
import java.util.LinkedList;
import com.utils.DateUtil;
import netscape.javascript.JSObject;

/**
 * java 调用 js
 * @author TANGJZ2
 *
 */
public class Java2Js {

	static JSObject win;
	private static LinkedList<String> linkedList = new LinkedList<String>(); 
	
	public static Object call(String paramString, Object... paramVarArgs){
		if(win != null){
			Object object = win.call(paramString, paramVarArgs);
			return object;
		}
		return null;
	}
	
	public static void pushMessage(String message){
//		message = DateUtil.format(new Date(), "yyyy-MM-dd HH:mm:ss.SSS") + "  " + message;
//		linkedList.add(message);
	}
	
	public static String popMessage(){
		if(linkedList.size()>0){
			return linkedList.pop();
		}else{
			return "";
		}
		
	}
	
}
